//
//  MemlistTableViewCell.m
//  zhixinApp
//
//  Created by zhiguanzhl on 2017/11/20.
//  Copyright © 2017年 zhiguanzhl. All rights reserved.
//

#import "MemlistTableViewCell.h"

@implementation MemlistTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
     [self _initSubView];
}
- (instancetype)initWithCoder:(NSCoder *)coder
{
    self = [super initWithCoder:coder];
    if (self) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        self.userInteractionEnabled = YES;
        self.accessoryView = nil;
        self.editingAccessoryView = nil;
        self.shouldIndentWhileEditing = NO;
    }
    return self;
}

- (void)_initSubView {
    
    _headerButton = [[UILabel alloc] init];
    _headerButton.frame = CGRectZero;
    _headerButton.backgroundColor = [UIColor colorWithHexString:@"#2c9ae8"];
    [self.contentView addSubview:_headerButton];
    
    _nickLabel = [[UILabel alloc]initWithFrame:CGRectZero];
    _nickLabel.textColor = [UIColor colorWithHexString:@"#666666"];
    
    [self.contentView addSubview:_nickLabel];
    
//    _contentLabel = [[UILabel alloc]initWithFrame:CGRectZero];
//    
//    _contentLabel.textColor = [UIColor colorWithHexString:@"#656565"];
//    [self.contentView addSubview:_contentLabel];
    
    _lineView = [[UIView alloc]initWithFrame:CGRectZero];
    _lineView.backgroundColor = KLineColor;
    [self.contentView addSubview:_lineView];
    
}

- (void)layoutSubviews {
    [super layoutSubviews];
    
    _headerButton.frame = CGRectMake(15, (self.height-40)*0.5, 40, 40);
    ViewRadius(_headerButton, _headerButton.width*0.5);
//    _headerButton.text =
    _headerButton.textColor = KWhiteColor;
    _headerButton.font = FONT(16);
    _headerButton.textAlignment = 1;
    
    _nickLabel.frame = CGRectMake(_headerButton.right+10, (self.height-25)*0.5, 100, 25);
    _nickLabel.font = FONT(18);
//    _contentLabel.frame = CGRectMake(_nickLabel.left, _nickLabel.bottom+5, kSCREEN_WIDTH-CGRectGetMinX(_nickLabel.frame), 25);
//    _contentLabel.font = FONT(17);
    _lineView.frame = CGRectMake(KSWidth(20), self.height-1, self.width-KSWidth(20), 1);
}
+ (instancetype)cellWithTableView:(UITableView *)tableView{
    static NSString *cellID = @"MemlistTableViewCell";
    MemlistTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
    if (!cell) {
        cell = [[NSBundle mainBundle]loadNibNamed:@"MemlistTableViewCell" owner:self options:nil].lastObject;
    }
    return cell;
}


@end
